﻿using RockBus.Composition.Interfaces;
using RockBus.Logging.Interfaces;
using RockBus.Routing.Interfaces;
using RockBus.ServiceModel;
using System.ServiceModel;

namespace RockBus.Services
{
    // http://support.microsoft.com/kb/2538826
    [WorkerThreadPoolBehavior]
    [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single,
        InstanceContextMode = InstanceContextMode.PerCall)]
    public partial class CbrService
    {
        // An IInstanceProvider wouldn't help much here
        //  Don't want to introduce Unity here
        //public CbrService(
        //    ILogger logger,
        //    ISubscriptionManager subscriptionManager,
        //    IReceivePort receivePort)
        //{
        //    this.Logger = logger;
        //    this.SubscriptionManager = subscriptionManager;
        //    this.ReceivePort = receivePort;
        //}

        public static ILogger Logger = DependencyManager.Instance.Resolve<ILogger>();

        public static IReceivePort ReceivePort = DependencyManager.Instance.Resolve<IReceivePort>();

        private readonly ConfigurationService ConfigurationService = new ConfigurationService();
    }
}